/**
 * Reset some basic elements
 */
body,
h1,
h2,
h3,
h4,
h5,
h6,
p,
blockquote,
pre,
hr,
dl,
dd,
ol,
ul,
figure {
    margin: 0;
    padding: 0;
}

/**
 * Set `margin-bottom` to maintain vertical rhythm
 */
h1,
h2,
h3,
h4,
h5,
h6,
p,
blockquote,
pre,
ul,
ol,
dl,
figure,
%vertical-rhythm {
    margin-bottom: 1rem;
}

/**
 * Images
 */
img {
    max-width: 100%;
    vertical-align: middle;
}

/**
 * Figures
 */
figure > img {
    display: block;
}

figcaption {
    font-size: $small-font-size;
}

/**
 * Clearfix
 */
%clearfix {
    &:after {
        content: "";
        display: table;
        clear: both;
    }
}

/**
 * Icons
 */
.icon {
    > svg {
        display: inline-block;
        width: 16px;
        height: 16px;
        vertical-align: middle;

        path {
            fill: $text-color;
        }
    }
}

/**
 * Rules & Feature Badges
 */
.rules-list {
    list-style: none;
    margin: 0 !important; //need to override the `main-content ul` selector

    > li {
        &:nth-child(odd) {
            a {
                background-color: rgba(0, 0, 0, 0.03);
            }
        }

        a {
            display: block;
            border-left: 3px solid transparent;
            text-decoration: none;
            padding: 0.75rem;

            &:hover {
                background-color: rgba(0, 0, 0, 0.075);
                border-left-color: #159957;
            }
        }
    }
}

.rule-features {
    //This is the container for a list of feature badges
    display: -webkit-box;
    display: -moz-box;
    display: -ms-flexbox;
    display: -webkit-flex;
    display: flex;
}

.feature {
    //This is the setup for the a feature badge
    display: inline-block;
    margin-right: 2px;
    padding: 2px 4px;
    font-weight: 700;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border: 1px solid transparent;
    border-radius: 0.25rem;
    cursor: help;

    &:before {
        //This is the setup for the icon that appears inside the badge
        display: inline-block;
        margin-right: 2px;
    }

    &.feature-sm {
        //This class is added to make the feature badge smaller.  This is used on the rules list
        padding: 1px 3px;
        font-size: 75%;
    }

    &.feature-ts-only {
        //This feature badge is added to rules that are "TypeScript Only"
        background-color: #fcf8e3;
        border-color: #faf2cc;
        color: #8a6d3b;

        &:before {
            content: "\1F4C4"; //"page facing up" icon - http://www.fileformat.info/info/unicode/char/1F4C4/index.htm
        }
    }

    &.feature-fixer {
        //This feature badge is added to rules that have an auto-fixer
        background-color: #dff0d8;
        border-color: #d0e9c6;
        color: #3c763d;

        &:before {
            content: "\1f527"; //"wrench" icon - http://www.fileformat.info/info/unicode/char/1f527/index.htm
        }
    }

    &.feature-requires-type-info {
        //This feature badge is added to rules that require type information
        background-color: #f2dede;
        border-color: #ebcccc;
        color: #a94442;

        &:before {
            content: "\2139"; //"information source" icon - http://www.fileformat.info/info/unicode/char/2139/index.htm
            //Surround it with a blue circle
            border-radius: 50%;
            background: #0078d7;
            color: #fff;
            width: 1em;
        }
    }
}

.wrapper__code-example {
    margin-bottom: 64px;

    &:last-of-type {
        margin-bottom: 24px;
    }

    h6.heading-fail {
        // Strong red
        color: #d14;
    }

    .code-example {
        // Light green
        background-color: #f1fff1;

        &.code-example-fail {
            // Light red
            background-color: #fff5f5;
        }

        pre,
        .highlight {
            background: transparent;
        }
    }
}
